﻿using LY.Entity;
using LY.Entity.Entities;
using LY.Entity.PageSearch;
using LY.Entity.SearchEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 

namespace LY.Interface
{
    public interface IFundsFlowService
    {
        /// <summary>
        /// 检索资金流动
        /// </summary>
        /// <param name="search"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        PagedList<FundsFlow_EX> QueryFundsFlowList(FundsFlowSearch search, PageView view);

        List<FundsFlow_EX> QueryFundsFlowList(int pageindex,int mid);
        int QueryFundsFlowCount(int mid);

          //待提现  导出
        List<FundsFlow_EX> QueryFundsExportList(FundsFlowSearch search);
        //获取资金实体
        FundsFlow_EX GetFundsFlow(int? id);

        //审核保存 
        int AuditSave(int? id, int status, string remark);

        /// <summary>
        /// 充值，提现
        /// </summary>
        /// <param name="fundsflow">资金流向</param>
        /// <param name="fee">手续费</param>
        /// <returns></returns>
        int FundsFlowSave(U_FundsFlow fundsflow,string fee);

        //账户资金
        FundsFlow_EX GetAccountInfo(int memberId);

        //验证订单唯一性
        int CheckOrderNo(string orderNo);

         //每个会员一天最多能提现3次
        int CheckDrawalCount(int memberId);

        /// <summary>
        /// 投标资金流
        /// </summary>
        /// <param name="fundsflow"></param>
        /// <returns></returns>
        int BiaoFundsFlow(U_FundsFlow fundsflow);

        /// <summary>
        /// 根据投标的投标号来获取当前的资金记录，投标号是不能重复的。
        /// </summary>
        /// <returns></returns>
        U_FundsFlow GetFundsFlowByOrderNo(string orderNo);

        /// <summary>
        /// 根据投标的投标号,和类型 来获取当前的资金记录，因为提现有2快抢的手续费，而且它的订单号和提现的订单号是一样的。
        /// </summary>
        /// <param name="orderNo"></param>
        /// <param name="type">充值是1 提现是2 投标是3 手续费是6</param>
        /// <returns></returns>
        U_FundsFlow GetFundsFlowByOrderNo(string orderNo,int type);

        /// <summary>
        /// 保存资金记录
        /// </summary>
        /// <param name="fundsflow"></param>
        /// <returns></returns>
        int UpdateFundsFlow(U_FundsFlow fundsflow);

        /// <summary>
        /// 查询当前用户充值的记录
        /// </summary>
        /// <param name="search"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        PagedList<U_FundsFlow> QueryFundsFlowList2(FundsFlowSearch search, PageView view);

        /// <summary>
        /// 新增资金流
        /// </summary>
        /// <param name="fundsflow"></param>
        /// <returns></returns>
        int InsertFundsFlow(U_FundsFlow fundsflow);

        /// <summary>
        /// 查询当前用户的余额
        /// </summary>
        /// <param name="memberId"></param>
        /// <returns></returns>
        decimal QueryBalance(int memberId);

        /// <summary>
        /// 流标处理
        /// </summary>
        /// <param name="parojectId"></param>
        /// <returns></returns>
        int LiuBiaoHandel(int parojectId);

    }
}
